package com.ludomancy.archeologyrpg.entities;

import java.awt.Graphics;
import java.awt.Point;
import java.util.Vector;

import com.ludomancy.archeologyrpg.Entity;
import com.ludomancy.archeologyrpg.Game;

public class Beacon extends Entity
{
	private boolean explored = false;
	private static final int EXPLORATION_RADIUS = 4 * Game.ENTITY_TILE_SIZE;
	
	public Beacon(Point p)
	{
		super(p);
	}
	
	public Beacon(int x, int y)
	{
		super(x, y);
	}

	public void paint(Graphics g, int x, int y)
	{
		paintDefaultIcon(g, BEACON, x, y);
	}
	
	public void update(boolean running, boolean activated)
	{
		// during first-time update, the beacon reveals
		// hidden interactions
		if(!explored)
		{
			explored = true;
			Vector entities = getCollisions(px, py, EXPLORATION_RADIUS);
			
			for (int i = 0; i < entities.size(); i++)
			{
				Entity entity = (Entity) entities.elementAt(i);
				if(entity.hidden)
				{
					entity.hidden = false;
				}
			}
		}		
		if(activated)
		{
		}
	}

	public void paintInfo(Graphics g)
	{
	}

	public String getActionVerb()
	{
		return null;
	}
}
